<?php
	
	header('Content-Type: application/json');
	
	require_once('database.php'); 
	
	Database::connect(); 
	
	$query = "SELECT username FROM users" ; 
	$result = Database::performQuery($query); 
	
	while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
		$users[] = array(
			'username' => $row['username'] 
		) ; 
	}	
	
	Database::disconnect(); 

	echo json_encode($users); 
	
?>